﻿@page
@inherits Acesoft.Web.UI.RazorPages.WebPage
@{
    Layout = "_shared/edit";
    ViewData["Title"] = "编辑";

    Ace.View().Id("view").Ajax(ds => ds.DataSource("wx.media").Form(new {
        app_id = App.GetQuery("appid", ""),
        type = "",
        name = "",
        url = "",
        remark = ""
    }).HttpSave()).Content(
        @<div class="container-fluid">
            <div class="row">
                <div class="col-xs-2 text-r"><span class="cr-red"></span> 素材类别：</div>
                <div class="col-xs-6">@Ace.ComboBox().Name("type").Width("100%").Ajax(a => a.Dict("WXMEDIA").HttpGet())</div>
                <div class="col-xs-4"></div>
            </div>
            <div class="row">
                <div class="col-xs-2 text-r"><span class="cr-red">*</span> 素材名称：</div>
                <div class="col-xs-6">@Ace.TextBox().Name("name").Width("100%").Required()</div>
                <div class="col-xs-4"></div>
            </div>
            <div class="row">
                <div class="col-xs-2 text-r"><span class="cr-red"></span> 素材Url：</div>
                <div class="col-xs-6">@Ace.TextBox().Name("url").Width("100%").Required()</div>
                <div class="col-xs-4">@Ace.LinkButton().Text("选择素材").Click("onSelect()").Css("c1").Width("80px")</div>
            </div>
            <div class="row">
                <div class="col-xs-2 text-r">备注：</div>
                <div class="col-xs-6">@Ace.TextBox().Name("remark").Width("100%")</div>
                <div class="col-xs-4"></div>
            </div>
            @Html.AntiForgeryToken()
        </div>
    ).Render();
}
<script>
    function onSelect() {
        AX.dialog('选择素材', '/_pages/photo', function (res) {
            $('#url').textbox('setValue', res)
        }, 650, 500)
    }
</script>